Skip to content

Support exporting jar#271

Merged
jdneo merged 48 commits into
microsoft:masterfrom
CsCherrYY:master
Jul 30, 2020
Merged

Support exporting jar#271
jdneo merged 48 commits into
microsoft:masterfrom
CsCherrYY:master

Conversation

@CsCherrYY
Copy link
Copy Markdown
Contributor

Add 'getMainMethod' command in jdtls.ext, which will return all the existing main methods of the workspace.

@ghost
Copy link
Copy Markdown

ghost commented Jun 23, 2020

CLA assistant check
All CLA requirements met.

@jdneo jdneo added this to the 0.10.2 milestone Jun 24, 2020
jdneo
jdneo previously approved these changes Jun 24, 2020
Copy link
Copy Markdown
Member

@jdneo jdneo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@jdneo jdneo modified the milestones: 0.10.2, 0.11.0 Jul 6, 2020
Support export jar feature.
@CsCherrYY CsCherrYY changed the title Add 'getMainMethod' command Support exporting jar Jul 16, 2020
Comment thread src/views/exportJarFile.ts Outdated
Comment thread src/views/exportJarFile.ts Outdated
Comment thread src/views/exportJarFile.ts Outdated
Comment thread src/views/exportJarFile.ts Outdated
Copy link
Copy Markdown
Member

@jdneo jdneo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As @testforstephen has mentioned, there are several unnecessary files/code in this PR. Please remove them first. Also, remember add license header when you adding a new file.

Comment thread jdtls.ext/target.target Outdated
Comment thread jdtls.ext/target.target Outdated
Comment thread package.nls.zh.json Outdated
Comment thread src/views/quickPickNode.ts Outdated
Comment thread src/views/projectPickNode.ts Outdated
@clankill3r
Copy link
Copy Markdown

Hi, this seams great.
Can you briefly explain how this exporting to a jar will work from a user perspective?

@CsCherrYY
Copy link
Copy Markdown
Contributor Author

Hi, this seams great.
Can you briefly explain how this exporting to a jar will work from a user perspective?

We will put an export jar button on the title of the Java Projects explorer. It will guide you to export your java project into a (runnable) jar with some necessary steps, such as choosing main method and dependencies.

Comment thread src/exportJarFileCommand.ts Outdated
Comment thread src/exportJarFileCommand.ts Outdated
Comment thread src/exportJarFileCommand.ts Outdated
case ExportSteps.ResolveProject: {
projectFolder = await resolveProject(pickSteps, node);
projectUri = Uri.parse(projectFolder);
rootNodes = await Jdtls.getProjects(projectUri.toString());
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is rootNode here meaning a project node?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not exactly. For maven project as an example, rootNodes is an Array which includes all the modules defined in pom.xml.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

submodules are still projects. rootNode is misleading here, what is root? is it workspace root? And what is node? we don't have tree structure here

Comment thread src/exportJarFileCommand.ts Outdated
Comment thread src/exportJarFileCommand.ts Outdated
Comment thread src/exportJarFileCommand.ts Outdated
Comment thread src/exportJarFileCommand.ts Outdated
Comment thread src/exportJarFileCommand.ts Outdated
Comment thread src/exportJarFileCommand.ts Outdated
Comment thread src/exportJarFileCommand.ts Outdated
Comment thread src/exportJarFileCommand.ts Outdated
Comment thread src/exportJarFileCommand.ts Outdated
Comment thread src/exportJarFileCommand.ts Outdated
Comment thread src/exportJarFileCommand.ts Outdated
Comment thread src/commands.ts
Comment thread src/commands.ts Outdated
java.view.package.exportJar ->
java.view.package.generateJar
Comment thread src/exportJarFileCommand.ts Outdated
Comment thread src/exportJarFileCommand.ts Outdated
Comment thread src/exportJarSteps/GenerateJarStep.ts Outdated
Comment thread src/exportJarSteps/IStep.ts Outdated
Comment thread src/views/dependencyDataProvider.ts
Comment thread src/exportJarSteps/ResolveMainMethodStep.ts Outdated
Comment thread src/exportJarFileCommand.ts Outdated
Comment thread src/exportJarFileCommand.ts Outdated
Comment thread src/exportJarFileCommand.ts Outdated
Comment thread src/exportJarFileCommand.ts Outdated
}, (progress, token) => {
return new Promise<IJarQuickPickItem[]>(async (resolve, reject) => {
token.onCancellationRequested(() => {
return reject();
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

return resolve([])

Comment thread src/exportJarSteps/StepGenerateJar.ts Outdated
Comment thread src/exportJarSteps/StepGenerateJar.ts Outdated
Comment thread src/exportJarFileCommand.ts Outdated
Comment thread src/exportJarFileCommand.ts Outdated
Comment thread src/exportJarFileCommand.ts Outdated
try {
step = await stepMap.get(step).execute(stepMetadata);
} catch (err) {
if (err === undefined) {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

return err ? reject(${err}) : reject()

}
const disposables: Disposable[] = [];
let pickBox: QuickPick<IJarQuickPickItem>;
const result = await new Promise<boolean>(async (resolve, reject) => {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

try {
} finally {}

1.Fix disposables bugs
2.move stepMap to grobal
Comment thread src/exportJarFileCommand.ts Outdated
Copy link
Copy Markdown
Member

@jdneo jdneo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@jdneo jdneo merged commit 23afff6 into microsoft:master Jul 30, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants